﻿using System;
using System.ServiceModel.Channels;
using System.ServiceModel;

namespace Microsoft.Biztalk.Adapters.Wcf.NullBinding
{
    class NullBinding : Binding
    {
        private NullBindingProperties properties;
        public bool IsQueued { get; set; }
        public bool LogMessages { get; set; }
        public bool IsTransacted { get; set; }
        public string MessageBody { get; set; }
        public float MessagesPerSecond { get; set; }
        public int NumberOfThreads { get; set; }
        
        public override BindingElementCollection CreateBindingElements()
        {
            this.properties = new NullBindingProperties();
            this.properties.LogMessages = this.LogMessages;
            this.properties.IsQueued = this.IsQueued;
            this.properties.IsTransacted = this.IsTransacted;
            this.properties.MessagesPerSecond = this.MessagesPerSecond;
            this.properties.MessageBody = this.MessageBody;
            this.properties.NumberOfThreads = this.NumberOfThreads;

            BindingElementCollection elements = new BindingElementCollection();
            elements.Add(new NullBindingTransportBindingElement(this.properties));
            return elements;
        }

        public override string Scheme
        {
            get { return Helpers.BindingScheme ; }
        }
    }
}
